﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Master.Master" AutoEventWireup="true" CodeBehind="Login.aspx.cs" Inherits="LaguzziCandidato.Login" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <script type="text/javascript">
        window.fbAsyncInit = function () {
            FB.init({
                appId: '355279404566156', //PRUEBA
                //appId: '1590578781192241', //PRODUCCIÓN
                xfbml: true,
                version: 'v2.3'
            });

            FB.getLoginStatus(function (response) {

                if (response.status === 'connected') {
                    if ($("#laVerga").length == 0) {
                        debugger
                        window.location.href = "Autenticar.aspx?token=" + response.authResponse.accessToken;
                    }
                }
            });
        };

        (function (d, s, id) {
            var js, fjs = d.getElementsByTagName(s)[0];
            if (d.getElementById(id)) { return; }
            js = d.createElement(s); js.id = id;
            js.src = "//connect.facebook.net/en_US/sdk.js";
            fjs.parentNode.insertBefore(js, fjs);
        } (document, 'script', 'facebook-jssdk'));
    </script>
    <div id="fb-root"></div> <!-- This initializes the FB controls-->
    <div class="fb-login-button" autologoutlink="true" scope="email" onlogin="javascript:window.location.reload()">
      Login with Facebook
     </div> <!-- FB Login Button --> 
</asp:Content>
